<?php
class EventsController extends AppController {

	var $name = 'Events';
	var $scaffold = 'admin';
	
	function index() {
		$this->set('events', $this->Event->find('all'));
		}
	
	function view($id) {
		$event = $this->Event->findById($id);
		$this->set('event', $event);
		foreach ($event['ticket'] as $key) {
			$event_ticket_array[$key['id']] = $key['name'];
			}
		$this->set('event_tickets', $event_ticket_array);
		}
}
?>